package com.situ.skymallgateway.config;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * 统一的认证用户信息载体
 * 由网关解析JWT后创建，并传递给下游微服务
 */
@Data
@NoArgsConstructor
public class AuthInfo implements Serializable {
    private static final long serialVersionUID = 1L;

    private String id;
    private String name;
    private String scope; // 角色范围, 例如 "ADMIN" 或 "USER"
    private Integer isSuper; // 仅当scope为ADMIN时有效

    public AuthInfo(String id, String name, String scope) {
        this.id = id;
        this.name = name;
        this.scope = scope;
    }
}

